Release 10.1A: OpenEdge Development:
Programming Interfaces
A printing solution
The OpenEdge ADE toolset provides a portable solution for printing text files. The solution is a procedure called
_osprint.pand it is located in theadecommprocedure library in the OpenEdge product directory (DLC). You can also access the source code for this procedure in thesrc/adecomm.plfile located in the OpenEdge product directory.The
_osprint.pprocedure sends a specified text file to the default printer as paged output. Input parameters for the procedure allow you to specify values that configure a print job. In Windows, you can also direct the_osprint.pprocedure to display the Print dialog box and print the text in a specified font. Use the following syntax to call the_osprint.pprocedure from a Progress procedure:
The parameters of the
_osprint.pprocedure are as follows:INPUTparentWindowA window handle identifying the parent window for Print dialog box and any print status messages in Windows. The procedure ignores a value specified for this parameter in character interfaces. If you specify the Unknown value (
?) or an invalid handle in Windows, the procedure uses theCURRENT–WINDOWhandle.INPUTprintFileA string value representing the name of a text file to print. You can specify an absolute or relative path for the file. The
_osprint.pprocedure uses the PROPATH to locate the file.INPUTfontNumberAn integer value representing an entry in the font table maintained by the
FONT–TABLEhandle. The_osprint.pprocedure uses the specified font to print the text file in Windows. The procedure ignores a value specified for this parameter in character interfaces. If you specify the Unknown value (?) or an integer value that does not exist in the font table for Windows, the procedure uses the default system font to print the text file.INPUTPrintFlagsAn integer value that determines which printing options are used for a print job in Windows (only). You can use the values in Table 5–1. If you need to use more than one option, add the values of the options together. In all cases, the
_osprint.pprocedure sets the value of thePRINTER–CONTROL–HANDLEattribute of theSESSIONhandle to zero (0).
INPUTpageSizeAn integer value representing the number of lines per page. If you specify zero (0) for this parameter, the printer determines the page size. Windows ignores this parameter and calculates the page size based on the Paper Size setting in the Print Setup dialog box and the font specified with the
Note: The maximum number of character per line is 255.fontNumberparameter.INPUTpageCountAn integer value that determines if
_osprint.pprints the entire text file or a range of pages from the text file in Windows. The procedure ignores a value specified for this parameter in character interfaces. If the value of this parameter is not zero (0) in Windows, Progress uses the page range specified for the current print context.OUTPUT resultA logical value that reports the success or failure of the print job.
To call the
_osprint.pprocedure from a Progress procedure, you must define a variable for the result output parameter. Here is an example:_osprint.p
The following list describes the important elements of the previous example:
For more information on the language elements referenced in this section, see the OpenEdge Development: Progress 4GL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |